Computer systems often provide a database management-system that manages the creation, deletion, and modification of records stored in a database. Such database management-systems must maintain the integrity of the database in spite of the possibility of (1) failure of the media upon which the database is recorded, (2) failure of the computer system in which the database management system is operating, or (3) failure of database transactions to successfully complete processing. These failures may be the result of hardware problems, software problems, or even the result of a complete loss of power to the computer system's main memory. Because main memory is generally volatile and requires power to maintain its stored information, such a power loss will result in loss of knowledge by the computer system as to changes being made to the database. In order to recover from such failures, prior database management-systems provided a journal of changes made to the database. Such a journal is stored in non-volatile storage devices, such as magnetic tape or disk.
A database management-system with journaling has slower performance than one without journaling because of the extra journal processing. When journaling, not only is the database-management system updating the database with a transaction, but it is also sending a journal record that describes the transaction to a journal controller for writing into the journal in non-volatile storage or in a remote computer system.
A method to increase journaling performance is to write journal records in a bundle to non-volatile storage. This bundling method consolidates individual records into a group, called a bundle, which reduces the overhead when compared to processing the same number of journal records individually because the journal controller and non-volatile storage can process the entire bundle at once. Just as it is more efficient to make one trip carrying a bundle of multiple sticks than it is to make multiple trips with individual sticks, it is more efficient to write one bundle of records to non-volatile storage simultaneously than it is to write multiple records at different times.
In a typical bundling method, a journal controller will accumulate journal records until the bundle reaches a fixed target-length. The journal controller then writes the entire bundle to non-volatile storage at once. Since the journal-record arrival-rate at the journal controller may be unpredictable, to ensure that the accumulated journal records are handled in a timely manner, the method typically starts a timer when the journal controller receives the first record in a bundle. When the timer expires, the journal controller will conclude the bundle and write it even if the bundle has not yet reached its target length.
This bundling method works well when the journal-record traffic-rate is high because the timer never expires. But when the journal-record traffic-rate is low, the records that the journal controller does receive experience poor performance while waiting in vain for additional journal-records to accumulate, and the ultimate timer expiration introduces additional processing overhead. Thus, the problem is that the target-length of the bundles is fixed while the journal-record traffic-rate is variable.
Another bundling method uses a variable bundle-size in an attempt to overcome the problems of fixed-length bundles. This method sets an arbitrary, initial optimum bundle-size and an optimum time. The optimum time is a predetermined, reasonable, waiting time for the bundle to be filled. When either the optimum bundle-size or the optimum time is reached, the contents of the bundle are transferred to non-volatile storage. If the optimum time is reached before the optimum bundle-size, then the optimum bundle-size is decreased and if vice versa, then the optimum bundle-size is increased. An example of this variable bundle-size method is illustrated in U.S. Pat. No. 4,159,517.
In another variable bundle-size method, the journal controller accumulates journal records until no database management-system processes are waiting to deposit records into the journal. The journal controller will then write the entire bundle at once. Here again, the method starts a timer when the journal controller receives the first record in a bundle, and when the timer expires, the journal controller concludes the bundle and processes it.
These variable bundle-size methods suffer from the problem that when the journal-record traffic is variable, the optimum bundle-size tends to oscillate between a large and a small size, which wastes processor and storage resources and thus degrades performance. A large optimum bundle-size will degrade performance of subsequent journal records when the journal-record traffic-rate subsequently decreases, and a small optimum bundle-size will degrade performance for subsequent journal records by causing the issuance of too many non-volatile storage write-operations when the journal-record traffic-rate subsequently increases. Thus, these variable bundle-size methods respond too rapidly to changes in the journal-record traffic-rate.
Therefore, there is a need for journal bundling that will overcome the disadvantages of the prior art and provide improved performance even in times of a light, variable, or unpredictable journal-record traffic rate.